using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using OpenComposite.EII.Repository;
using OpenComposite.Repository.Properties;

namespace OpenComposite.EII.RepositoryUIs
{
	public partial class UCSOBA : RepositoryItemUI
	{
		#region Initialization
		public UCSOBA(IServiceProvider serviceProvider)
			: base(serviceProvider)
		{
			InitializeComponent();

			init();
		}
		private void init()
		{
		}
		#endregion

		#region Public Members

		#region Properties
		public override IRepositoryItem RepositoryItem
		{
			get
			{
				save();
				return _soba;
			}
			set
			{
				if ( value is SOBA ) {
					_soba = (SOBA)value;
					load();
				}
			}
		}

		public override string TypeText
		{
			get { return Resources.sSOBA; }
		}

		public override string TypeDescription
		{
			get { return ""; }
		}
		#endregion

		#endregion

		#region Private Members

		#region Variables
		private SOBA _soba = null;
		#endregion

		#region Methods
		private void load()
		{
			if ( _soba == null )
				return;

			_soba.Reload();

			txtName.Text = _soba.Name;
			txtDesc.Text = _soba.Description;
		}
		private void save()
		{
			if ( _soba == null )
				_soba = new SOBA();

			_soba.Reload();

			_soba.Name = txtName.Text;
			_soba.Description = txtDesc.Text;

		}
		#endregion

		#region Event Handlers
		#endregion

		#endregion

	}
}
